﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Alex.WPFLibrary
{
    /// <summary>
    /// Логика взаимодействия для AddName.xaml
    /// </summary>
    public partial class AddName : Window
    {
        public AddName()
        {
            InitializeComponent();
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        public string ResultName
        {
            get 
            {
                if (textBox.Text == "") return "NoName";
                return textBox.Text;
            }
        }

        public string ObjectType
        {
            get { return comboBoxType.Text; }
        }

        private void textBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter) button_Click(sender, new RoutedEventArgs());
        }
    }
}
